<?php
namespace Admin\Controller;
use Think\Controller;
class ArticleController extends BaseController {
	 public function _before_edit() {
		$arcoModel = D('ArticleColumn');
		$arco = $arcoModel
		         ->field(array('arco_id as value','arco_name as name'))
		         ->where(array('arco_status'=>1))
		         ->select();
		$this->assign('arcolist',$arco);
		
	}
	public function _before_add() {
		$this->_before_edit();
		
	}
	 /**
     * *
     * @param  [type] $arco_id [传递过来的栏目id]
     * @return [type] ￥return [要返回的关于文章分类的数据]
     */
	public function get_arc(){
		$arco_id=I('request.arco_id');
		$data='<option>无相关数据</option>';
		if (!empty($arco_id)){
		    $model=M('ArticleCategory');
	        $fields=array('arc_id','arc_name');
	        $arcList=$model->field($fields)
	                ->where(array('arco_id'=>$arco_id))
	                ->select();
	        if($arcList){
	        	$data='';
	        	foreach($arcList as $value){
                    $data.='<option value="'.$value['arc_id'].'">'.$value['arc_name'].'</option>';
	        	}
	        }
		}
        echo $data;exit();
	}
}              